$(function(){						
	///// TRANSFORM CHECKBOX /////							
	$('input:checkbox').uniform();
	
	///// LOGIN FORM SUBMIT /////
	$('#login').on('click' ,function(){
		if($('#username').val() != '' && $('#password').val() != '') {
			$('.nousername').fadeOut();
			$('#loadingdiv').fadeIn();
			setInterval(function(){
				$('#loadingdiv').fadeOut();
				window.location.href = 'index.html';
			},1000);
			return false;	
		}
		
		if($('#username').val() == '' && $('#password').val() == '') {
			$('.nousername').fadeIn().children('.loginmsg').text('请输入用户名和密码');
			return false;	
		}

		if($('#username').val() != '' && $('#password').val() == '') {
			$('.nousername').fadeIn().children('.loginmsg').text('请输入密码');
			return false;;
		}

		if($('#username').val() == '' && $('#password').val() != '') {
			$('.nousername').fadeIn().children('.loginmsg').text('请输入用户名');
			return false;;
		}
	});
	
	///// ADD PLACEHOLDER /////
	$('#username').attr('placeholder','Username');
	$('#password').attr('placeholder','Password');
});
